package com.oauth.controller;

import org.springframework.security.oauth2.provider.token.ConsumerTokenServices;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 删除令牌
 * @author ytj
 * @date 2021/12/13
 */
@RestController
@RequestMapping("/token/demo")
public class TokenDemoController {
    @Resource
    private ConsumerTokenServices tokenServices;

    @PostMapping("/revoke")
    public boolean revokeToken(@RequestParam("token")String token){
        return this.tokenServices.revokeToken(token);
    }

}
